﻿@{
    ViewData["Title"] = "邀请表";
    Layout = "~/Areas/Manager/Views/Shared/_Layout.cshtml";
}
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">邀请信息</div>
                <div class="layui-card-body">
                    <div class="layui-form">
                        <div class="layui-row">
                            <div class="layui-form-item">
                                <div class="layui-col-md3" style="padding-left:0">
                                    <div class="input-group">
                                        <input type="text" id="keyWords" name="keyWords" placeholder="请输入关键词" autocomplete="off" class="layui-input">
                                        <span class="input-group-btn">
                                            <button class="layui-btn" id="search">
                                                <i class="layui-icon layui-icon-search"></i>
                                            </button>
                                        </span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-row">
                        <div class="layui-btn-container">
                            <div class="layui-btn-group">
                            </div>
                        </div>
                    </div>
                    <div class="layui-row">
                        <table class="layui-table " lay-data="{page:true, id:'list'}" lay-filter="list">
                            <thead>
                                <tr>
                                    <th lay-data="{checkbox:true, fixed: true,style:'height:80px;'}"></th>
                                    <th lay-data="{ field: 'userName'}">被邀请人用户名</th>
                                    <th lay-data="{ field: 'userNick'}">被邀请人昵称</th>
                                    <th lay-data="{ field: 'inviteUserName'}">邀请人用户名</th>
                                    <th lay-data="{ field: 'inviteNick'}">邀请人</th>
                                    <th lay-data="{ field: 'isRebate',templet:'#isRebate',align:'center'}">返还话费</th>
                                    <th lay-data="{ field: 'status',templet:'#status',align:'center'}">状态</th>
                                    <th lay-data="{ field: 'createDate'}">创建时间</th>
                                    <th lay-data="{toolbar:'#tableoption'}">操作</th>
                                </tr>
                            </thead>
                        </table>
                        <script type="text/html" id="tableoption">
                            <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="info"><i class="layui-icon">&#xe63c;</i>查看</a>
                        </script>
                        <script type="text/html" id="status">
                            {{#  if(d.status==0){  }}
                            <span class="layui-badge layui-bg-green">启用</span>
                            {{#  } else if(d.status==1){ }}
                            <span class="layui-badge layui-bg-orange">禁用</span>
                            {{#  } }}
                        </script>
                        <script type="text/html" id="isRebate">
                            {{#  if(d.isRebate==true){  }}
                            <span class="layui-badge layui-bg-green">已返利</span>
                            {{#  } else{ }}
                            <span class="layui-badge layui-bg-orange">未返利</span>
                            {{#  } }}
                        </script>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

@section scriptsfeet
    {
    <script type="text/javascript">
        layui.config({
            base: '/layuiadmin/' //自定义模块路径
        }).use(['sykjwh', 'table','form'], function () {
            var $ = layui.$, sykjwh = layui.sykjwh, table = layui.table,form=layui.form;

            //绑定数据
            sykjwh.dataBind('@Url.Action("List", "userinvite", new { area = Constant.AREAMANAGER })');

            //搜索
            $("#search").click(function () {
                //绑定数据
                sykjwh.dataBind('@Url.Action("List", "userinvite", new { area = Constant.AREAMANAGER })', {
                    keyWords: $.trim($("#keyWords").val())
                });
            });
        });
    </script>
}